package com.chukun.dubbo.spi.service.impl;

import com.chukun.dubbo.spi.service.Order;
import org.apache.dubbo.common.URL;

/**
 * @author chukun
 * @version 1.0.0
 * @description Wrapper 机制，即扩展类的包装机制,order类的扩展
 * @createTime 2021年12月26日 20:57:00
 */
public class OrderWrapper implements Order {

    private Order order;

    public  OrderWrapper(Order order) {
        this.order = order;
    }
    @Override
    public String way() {
        System.out.println("before-OrderWrapper对way()的增强");
        String way = order.way();
        System.out.println("after-OrderWrapper对way()的增强");
        return way;
    }

    @Override
    public String pay(URL url) {
        System.out.println("before-OrderWrapper对pay()的增强");
        String pay = order.pay(url);
        System.out.println("after-OrderWrapper对pay()的增强");
        return pay;
    }
}
